import request from "../utils/request"
const getlist=(query)=>{
  return request.get("/api/getlist",{params:query})
}
const deel=(data)=>{
    return request.post("/api/getlistd",data)
  }
  const removb=(data)=>{
    return request.post("/api/getremove",data)
  }
  const search=(data)=>{
    return request.post("/api/search",data)
  }
  const bianji=(data)=>{
    return request.post("/api/bianji",data)
  }
  const getli=(query)=>{
    return request.get("/api/getli",{params:query})
  }

//秒杀配置数据
function goodlist(data) {
    return request.post('/api/list', data)
}
//秒杀配置删除
function kdelete(data) {
    return request.post('/api/del', data)
}
//秒杀配置搜索接口
function ksearch(data) {
    return request.post('/api/oplist', data)
}
//秒杀商品数据
function management(data) {
    return request.post('/api/management', data)
}
//秒杀商品删除
function delele(data) {
    return request.post('/api/delele', data)
}
//秒杀商品搜索
function lookup(data) {
    return request.
        post('/api/lookup', data)
}
//秒杀配置编辑
function edit(data) {
    return request.post('/api/lookuo', data)
}


//直播数据
function getlivelist(data) {
    return request.post('/api/livelist', data)
}

//添加直播
function getaddlist(data) {
    return request.post('/api/addlive', data)
}

//更改直播状态
function setZhiboState(data) {
    return request.post('/api/setZhiboState', data)
}


const getGoodsList = (data) => {
    return request.post("/api/getCommodityData", data);
};
// 加入回收站
const addRecycleList = (data) => {
    return request.post("/api/addhuishouzhan", data);
};
// 删除
const delGoodsList = (data) => {
    return request.post("/api/delshopdata", data);
};
// 获取商品分类的数据
const getGoodsClass = (data) => {
    return request.post("/api/getgoodsclass", data);
};
// 删除商品分类
const delshopclass = (data) => {
    return request.post("/api/delshopclass", data);
};

// 改变商品分类的状态
const changeClassSwitch = (data) => {
    return request.post("/api/changeClassSwitch", data);
};

export {
    goodlist,
    kdelete,
    ksearch,
    management,
    delele,
    lookup,
    edit,
    getGoodsList,
    addRecycleList,
    delGoodsList,
    getGoodsClass,
    delshopclass,
    changeClassSwitch,
    getlivelist,
    getaddlist,
    getlist,
    deel,
    search,
    bianji,
    getli,
    removb,
    setZhiboState,
};
